package com.example.manu_facturer_orders.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.manu_facturer_orders.pojo.FacturerPaymentVO;
import com.example.manu_facturer_orders.pojo.PageResult;
import com.example.manu_facturer_orders.service.FacturerPaymentService;
import commons.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: tobed
 * @date: 2022/9/14
 * @time: 16:11
 */
@RestController
@RequestMapping("facturerPayment")
public class FacturerPaymentController {

    @Autowired
    FacturerPaymentService facturerPaymentService;

    /**
     * 厂商支付单全查
     * @param billDate
     * @param pageResult
     * @return
     */
    @RequestMapping("listPayMent")
    public Result listPayMent(
            @RequestParam String billDate,
            @RequestParam Integer billType,
            @RequestParam Integer billUserType,
            PageResult pageResult){
        Page<FacturerPaymentVO> page = facturerPaymentService.listPayMent(billDate,billType,billUserType,new Page<>(pageResult.getPageNum(), pageResult.getPageSize()));
        return Result.success(page);
    }

    /**
     * 下拉框日期全查
     * @return
     */
    @PostMapping("listBillDate")
    public Result listBillDate(){
        Result result = facturerPaymentService.listBillDate();
        return result;
    }

}
